""" 将ts文件转换成mp4视频文件 """
import os
import json

# 读取json文件内容,返回字典格式
def getJson():
    # 获取相对位置
    path = os.path.dirname(os.path.abspath(__file__))
    with open(path+'\config.json', 'r', encoding='utf8')as fp:
        myjson = json.load(fp)
    return myjson

if __name__ == "__main__":
    print(getJson()["download_path"])
    # 保存ts文件的保存地址
    download_path = getJson()["download_path"]+"\combine.ts"
    # 转换后的地址
    combine_path = getJson()["download_path"]+"\\video.mp4"
    com = "copy /b %s %s" % (download_path, combine_path)
    print(" ======================= 查看命令是否正确，特别是路径是否正确！======================= ")
    print(com)
    os.system(r"%s" % (com))
